Socket
Socket
Sign inDemoInstall

turf-sample

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-sample

turf sample module


Version published
Weekly downloads
12K
decreased by-1.27%
Maintainers
1
Weekly downloads
 
Created
Source

turf-sample

Build Status

Takes a feature collection and returns N random features as a feature collection.

###Install

npm install turf-sample

###Parameters

namedescription
fca FeatureCollection
numnumber of features to sample

###Usage

sample(fc, num)

###Example

var sample = require('turf-sample')
var fs = require('fs')

var pts = JSON.parse(fs.readFileSync('/path/to/pts.geojson'))
var num = 10

var sampled = sample(pts, num)

console.log(sampled)

Keywords

FAQs

Package last updated on 17 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc